package com.bangdao.app.jetpacktest.jetpack.viewmodel;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.blankj.utilcode.util.ActivityUtils;

public class ViewModelListActivity extends ListActivity {

    private String[] data = {"ViewModel计时器", "常规方式计时器"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ArrayAdapter arrayAdapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, data);
        setListAdapter(arrayAdapter);
    }

    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        super.onListItemClick(l, v, position, id);

        switch (data[position]){
            case "ViewModel计时器": ActivityUtils.startActivity(TimerActivity.class);
                break;
            case "常规方式计时器": ActivityUtils.startActivity(NormalTimerActivity.class);
                break;
        }
    }
}